/**
 * Created by Harvey Zhao on 2016/8/19.
 */

var mongoose = require('mongoose');
var shortid = require('shortid');
var Schema = mongoose.Schema;

var AdminGroup = require('./AdminGroup');

var AdminUserSchema = new Schema({
    _id: {
        type: String,
        unique: true,
        'default': shortid.generate
    },
    name: String,
    userName: String,
    password: String,
    comments: String,
    date: { type: Date, default: Date.now },
    role: {
        type: String,
        ref: 'AdminRole'
    }
});


var AdminUser = mongoose.model("AdminUser", AdminUserSchema);

module.exports = AdminUser;

